@extends('layouts.mall')

@section('styles')
    <link href="{{asset('css/index/index.css')}}" rel="stylesheet" type="text/css">
@stop

@section('scripts')
    <script src="{{asset('swiper/js/swiper.min.js')}}" type="text/javascript"></script>
@stop

@section('content')
    <div class="color-wapper duanwu-bg" style="padding-top: 0; padding-bottom: 20px;">
        <div class="area">
            <div class="category-panel">
                <ul class="cat-list list-unstyled" id="cat-list">
                    @foreach ($catlogList as $catlog)
                        <li><a href="{{item_search_url(['catid'=>$catlog['catid'], 'q'=>$catlog['name']])}}"><span>{{$catlog['name']}}</span></a></li>
                    @endforeach
                </ul>
                <div class="childs-panel" id="childs-panel">
                    @foreach ($catlogList as $catlog)
                        <div class="cat-group">
                            <h3><a href="{{item_search_url(['catid'=>$catlog['catid'], 'q'=>$catlog['name']])}}" class="more">更多 >></a> {{$catlog['name']}}</h3>
                            <ul>
                                @foreach ($catlog['childs'] as $child)
                                    <li><a href="{{item_search_url(['catid'=>$child['catid'], 'q'=>$child['name']])}}">{{$child['name']}}</a></li>
                                @endforeach
                            </ul>
                        </div>
                    @endforeach
                </div>
            </div>
            <div class="home-main">
                <div class="swiper-div" id="swiper-div">
                    <div class="swiper" id="swiper">
                        <ul class="swiper-wrapper">
                            @foreach ($slideList as $item)
                                <li class="swiper-slide"><a href="{{$item['url']}}" target="_blank"><img src="{{image_url($item['image'])}}"></a></li>
                            @endforeach
                        </ul>
                        <div class="swiper-pagination"></div>
                    </div>
                </div>
                <script type="text/javascript">
                    (function(){
                        var swiper = new Swiper('#swiper',
                           {loop:true,pagination:'.swiper-pagination',autoplay:2500});
                    })();
                </script>
                <div class="news">
                    <div class="content">
                        <h3>粗耕头条</h3>
                        <ul class="list-unstyled">
                            @foreach ($newsList as $item)
                                <li><a href="{{post_url($item['aid'])}}" target="_blank">&bull; {{$item['title']}}</a></li>
                            @endforeach
                        </ul>
                        <div class="ad"></div>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $("#cat-list li").mouseenter(function (e) {
                    var self = this;
                    $(this).addClass('cur').siblings().removeClass('cur');
                    $("#childs-panel").show();
                    $("#childs-panel .cat-group").eq($(this).index()).show().siblings('.cat-group').hide();
                    $(document).mousemove(function (e) {
                        $("#childs-panel").hide();
                        $(self).removeClass('cur');
                    });
                }).mousemove(function (e) {
                    DSXUtil.stopPropagation(e);
                });
                $("#childs-panel").mousemove(function (e) {
                    DSXUtil.stopPropagation(e);
                });
            });
        </script>
        <div class="blank"></div>
        <div class="area">
            <h1 class="title" style="color: #fff;">超值抢购</h1>
            <ul class="quangou list-unstyled">
                @foreach ($qiangGou as $item)
                    <li>
                        <div class="image">
                            <a href="{{item_url($item['itemid'])}}" target="_blank">
                                <div class="bg bg-cover" style="background-image: url({{image_url($item['thumb'])}})"></div>
                            </a>
                        </div>
                        <div class="title">{{mbsubstr($item['title'], 24)}}</div>
                        <div class="data">
                            <div class="price">￥{{$item['price']}}</div>
                            <div class="sold">已抢{{formatCount($item['sold'])}}件</div>
                        </div>
                    </li>
                @endforeach
                <li class="last"></li>
            </ul>
        </div>
    </div>
    <div class="color-wapper" style="background-color: #FFA133;">
        <div class="area">
            <h1 class="title" style="color: #fff">粗耕优选</h1>
            <ul class="youxuan">
                @foreach ($youxuanList as $item)
                    <li>
                        <div class="bd">
                            <div class="pic bg-cover" style="background-image: url({{image_url($item['thumb'])}})">
                                <a href="{{item_url($item['itemid'])}}" target="_blank"></a>
                            </div>
                            <div class="name"><a href="{{item_url($item['itemid'])}}" target="_blank">{{$item['title']}}</a></div>
                            <div class="price">
                                <strong class="shop-price">￥{{$item['price']}}</strong>
                            </div>
                            <div class="buynow">
                                <a href="{{item_url($item['itemid'])}}" target="_blank" class="btn">立即购买</a>
                            </div>
                        </div>
                    </li>
                @endforeach
            </ul>
        </div>
    </div>

    <div class="color-wapper">
        <div class="area">
            <div class="bigtitle"><strong>新/鲜/水/果</strong></div>
            <div class="item-catlog-div">
                <div class="catlogs fresh-catlog bg-cover">
                    <div class="content">
                        <h3 class="title">新鲜水果</h3>
                        <div class="subtitle">应时而采，新鲜特供</div>
                        <div class="cats">
                            <a href="{{item_search_url(['catid'=>48, 'q'=>'桃子'])}}" target="_blank">桃子</a>
                            <a href="{{item_search_url(['catid'=>91, 'q'=>'李子'])}}" target="_blank">李子</a>
                            <a href="{{item_search_url(['catid'=>87, 'q'=>'火龙果'])}}" target="_blank">火龙果</a>
                            <a href="{{item_search_url(['catid'=>90, 'q'=>'猕猴桃'])}}" target="_blank">猕猴桃</a>
                            <a href="{{item_search_url(['catid'=>93, 'q'=>'蓝莓'])}}" target="_blank">蓝莓</a>
                            <a href="{{item_search_url(['catid'=>94, 'q'=>'提子'])}}" target="_blank">提子</a>
                        </div>
                        <div class="more-btn"><a href="{{item_search_url(['catid'=>131])}}" target="_blank">更多水果</a></div>
                    </div>
                </div>

                <div class="catlog-img1 fresh-catlog-img1 bg-cover">

                </div>
                <div class="catlog-img2 fresh-catlog-img2">

                </div>
            </div>
            <div class="item-group-list">
                <ul>
                    @foreach ($fruits as $item)
                        <li>
                            <div class="content">
                                <div class="imgbox">
                                    <a href="{{item_url($item['itemid'])}}" target="_blank">
                                        <div class="image bg-cover" style="background-image: url({{image_url($item['thumb'])}})"></div>
                                    </a>
                                </div>
                                <div class="title">{{mbsubstr($item['title'], 22)}}</div>
                                <div class="price">￥{{$item['price']}}</div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>
        </div>
    </div>

    <div class="color-wapper">
        <div class="area">
            <div class="bigtitle"><strong>新/鲜/蔬/菜</strong></div>
            <div class="item-catlog-div">
                <div class="catlogs fresh-catlog bg-cover">
                    <div class="content">
                        <h3 class="title">新鲜蔬菜</h3>
                        <div class="subtitle">应时而采，新鲜特供</div>
                        <div class="cats">
                            <a href="{{item_search_url(['catid'=>78, 'q'=>'白菜'])}}" target="_blank">白菜</a>
                            <a href="{{item_search_url(['catid'=>79, 'q'=>'菠菜'])}}" target="_blank">菠菜</a>
                            <a href="{{item_search_url(['catid'=>80, 'q'=>'油菜'])}}" target="_blank">油菜</a>
                            <a href="{{item_search_url(['catid'=>81, 'q'=>'玉米'])}}" target="_blank">玉米</a>
                            <a href="{{item_search_url(['catid'=>82, 'q'=>'黄瓜'])}}" target="_blank">黄瓜</a>
                            <a href="{{item_search_url(['catid'=>83, 'q'=>'茄子'])}}" target="_blank">茄子</a>
                        </div>
                        <div class="more-btn"><a href="{{item_search_url(['catid'=>47])}}" target="_blank">更多蔬菜</a></div>
                    </div>
                </div>

                <div class="catlog-img1 vegetables-catlog-img2 bg-cover">

                </div>
                <div class="catlog-img2 vegetables-catlog-img3 bg-cover">

                </div>
            </div>
            <div class="item-group-list">
                <ul>
                    @foreach ($vegetables as $item)
                        <li>
                            <div class="content">
                                <div class="imgbox">
                                    <a href="{{item_url($item['itemid'])}}" target="_blank">
                                        <div class="image bg-cover" style="background-image: url({{image_url($item['thumb'])}})"></div>
                                    </a>
                                </div>
                                <div class="title">{{mbsubstr($item['title'], 22)}}</div>
                                <div class="price">￥{{$item['price']}}</div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>
        </div>
    </div>

    <div class="color-wapper">
        <div class="area">
            <div class="bigtitle"><strong>粮/油/副/食</strong></div>
            <div class="item-catlog-div">
                <div class="catlogs fushi-catlog bg-cover">
                    <div class="content">
                        <h3 class="title">粮油副食</h3>
                        <div class="subtitle">肉香四溢，大快朵颐</div>
                        <div class="cats">
                            <a href="{{item_search_url(['catid'=>62, 'q'=>'面食'])}}" target="_blank">面食</a>
                            <a href="{{item_search_url(['catid'=>109, 'q'=>'五谷杂粮'])}}" target="_blank">五谷杂粮</a>
                            <a href="{{item_search_url(['catid'=>63, 'q'=>'大米'])}}" target="_blank">大米</a>
                            <a href="{{item_search_url(['catid'=>92, 'q'=>'方便速食'])}}" target="_blank">方便速食</a>
                            <a href="{{item_search_url(['catid'=>64, 'q'=>'食用油'])}}" target="_blank">食用油</a>
                            <a href="{{item_search_url(['catid'=>66, 'q'=>'南北干货'])}}" target="_blank">南北干货</a>
                        </div>
                        <div class="more-btn"><a href="{{item_search_url(['catid'=>50])}}" target="_blank" style="color: #F27961;">更多食品</a></div>
                    </div>
                </div>

                <div class="catlog-img1 fushi-catlog-img1 bg-cover">

                </div>
                <div class="catlog-img2 fushi-catlog-img2">

                </div>
            </div>
            <div class="item-group-list">
                <ul>
                    @foreach ($fushi as $item)
                        <li>
                            <div class="content">
                                <div class="imgbox">
                                    <a href="{{item_url($item['itemid'])}}" target="_blank">
                                        <div class="image bg-cover" style="background-image: url({{image_url($item['thumb'])}})"></div>
                                    </a>
                                </div>
                                <div class="title">{{mbsubstr($item['title'], 22)}}</div>
                                <div class="price">￥{{$item['price']}}</div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>
        </div>
    </div>
@stop

@section('foot')

@stop
